<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:p="http://primefaces.org/ui" template="/layout/template.xhtml">
	<ui:define name="body">
		<h1 class="title ui-widget-header ui-corner-all">#{message['generar.lista.panel']}</h1>
		<h:form id="formGenerarCobranza">
			<p:messages id="message" showDetail="true" closable="true" />
			<p:panel header="#{message['panel.generar.cobranza']}">
				<h:panelGrid columns="2" cellpadding="4" >
				<h:outputText value="#{message['generar.tipo.cobranza']}" />
				<p:selectOneMenu  value="#{cobranza.tipoCobranza}" required="true" >
					<f:selectItem itemLabel="Seleccione una opción" itemValue="#{null}" />
					<f:selectItems  value="#{comboAction.tipoCobranzaItems}" />
				</p:selectOneMenu>
				
				<h:outputText value="#{message['generar.lista.empleados']}" />
				<p:spacer/>
				
                </h:panelGrid>
				<p:pickList id="pojoPickList" value="#{cobranza.teleoperadoras}" var="e" effect="blind"  
                    itemValue="#{e}" itemLabel="#{e.nombresCompletos}" converter="teleoperadoraConverter"  
                    showSourceControls="true" showTargetControls="true" showCheckbox="true"  
                    addLabel="#{message['btn.add']}" addAllLabel="#{message['btn.add.all']}"  
                    removeLabel="#{message['btn.remove']}" removeAllLabel="#{message['btn.remove.all']}"
                    moveBottomLabel="#{message['btn.move']}" moveDownLabel="#{message['btn.move.down']}" 
                    moveTopLabel="#{message['btn.move.top']}" moveUpLabel="#{message['btn.move.up']}"
                    showSourceFilter="true" showTargetFilter="true" filterMatchMode="contains" >  
                    <f:facet name="sourceCaption">#{message['asignar.teleoperadores']}</f:facet>
                    <f:facet name="targetCaption">#{message['asignar.seleccionados']}</f:facet> 
                    <p:column> #{e.nombresCompletos}</p:column>
                </p:pickList>
				<p:commandButton action="#{cobranza.insertar}" value="#{message['generar.listar.generar']}"
				onclick="statusDialogCob.show()" update="message, selectCob" icon="ui-icon-disk" iconPos="rigth" />
				
			</p:panel>
			<p:fieldset id="selectCob"  legend="#{message['asignar.cobranza.restante']}" style="margin-top:30px" >
			<h:panelGrid columns="2" >
				<p:dataTable var="d" value="#{cobranza.cobranzaModel}" paginator="true" rows="5" rowKey="#{d.tbCliente.idcliente}"
				selection="#{cobranza.selectedCob}" style="width:50%" emptyMessage="#{message['rsltd.empty']}">
					<f:facet name="header">#{message['asignar.cobranza.por.asignar']}</f:facet>
					<p:column selectionMode="multiple" style="width:2%" />
					<p:column headerText="#{message['asignar.cliente']}" style="width:30%"> #{d.tbCliente.nombresCompletos}  
					</p:column>
					<p:column headerText="#{message['asignar.tipo.cliente']}" style="width:5%"> #{d.tbCliente.tbTipoCliente.descripcion}
					</p:column>
					<p:column headerText="#{message['asignar.codigo.contrato']}"  style="width:5%"> #{d.tbContrato.codcontrato}
					</p:column>
					<p:column headerText="#{message['asignar.cuota']}" style="width:5%"> #{d.numletra}
					</p:column>
					<f:facet name="footer">
						<p:commandButton  value="View" icon="ui-icon-search"  
	                    update=":fr:displayMulti" oncomplete="cobDialog.show()"/> 
                    </f:facet>
                </p:dataTable>
                <h:panelGrid columns="2" >
	                <h:outputText value="#{message['asignar.teleoperador']}" />
					<p:selectOneMenu  value="#{cobranza.operadorasignado}"  >
						<f:selectItem itemLabel="Seleccione una teleoperador(a)" itemValue="#{null}" />
						<f:selectItems  value="#{cobranza.lstEmpleados}" var="l" itemLabel="#{l.nombresCompletos}" itemValue="#{l.idempleado}"  />
					</p:selectOneMenu>
				</h:panelGrid>
				<f:facet name="footer">
					<p:commandButton action="#{cobranza.asignarcobranzarestante}" value="#{message['generar.listar.generar']}"
					 update="message,selectCob" icon="ui-icon-disk" iconPos="rigth" onclick="cobDialog.show()" />
				</f:facet>
            </h:panelGrid>
            </p:fieldset>
		</h:form>
	</ui:define>
</ui:composition>